package com.runen.infinitemovement.adapter;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.runen.infinitemovement.R;
import com.runen.infinitemovement.model.entity.StaffsEntity;
import com.runen.infinitemovement.tool.GlideUtils;
import com.runen.infinitemovement.widget.imageview.RoundedCornersImage;

import java.util.List;

public class LastTeamGroupAdapter extends BaseQuickAdapter<StaffsEntity, BaseViewHolder> {
    private Context context;

    public LastTeamGroupAdapter(Context context) {
        super(R.layout.item_last_team_group);
        this.context = context;
    }


    @Override
    protected void convert(@NonNull BaseViewHolder helper, StaffsEntity item) {
        RoundedCornersImage rci_user_header = helper.getView(R.id.rci_user_header);
        GlideUtils.loadImage(context, item.headImage+"?x-oss-process=image/resize,m_fill,w_144,h_144", rci_user_header);
        helper.setText(R.id.tv_user_name, item.userName);
        TextView tv_fu = helper.getView(R.id.tv_fu);
        if (item.isLeader) {
            tv_fu.setVisibility(View.VISIBLE);
        } else {
            tv_fu.setVisibility(View.GONE);
        }
    }
}
